Refactor OAuth2 Client Deprecate Calls#18513
Closed
paulvas wants to merge 1 commit into
Closed
Conversation
…related tests - Refactor and modernize OAuth2 client provider and test code - Update to new Jackson and HTTP message converter APIs in tests - Minor bug fixes and code style improvements Closes spring-projectsgh-18433 Signed-off-by: paulvas <paulvas@gmail.com>
Collaborator
Contributor
Author
|
@jgrandja, should I open another PR for remaining changes? |
Collaborator
|
@paulvas Sure, as long it's not related to Nullability. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the OAuth2 client codebase to improve nullability annotations and enhance thread safety and static analysis in token expiration checks. The most important changes are grouped below:
Nullability annotation improvements:
Replaces
org.springframework.lang.Nullablewithorg.jspecify.annotations.Nullablethroughout the OAuth2 client codebase to standardize nullability annotations. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Updates method signatures by moving the
@Nullableannotation inline with method declarations forauthorizeandgetAuthorizedClientmethods in various classes and interfaces, improving code clarity and consistency. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Token expiration check improvements:
hasTokenExpiredmethod in several providers to store the token's expiration time in a local variable before performing null checks and calculations. This change improves thread safety and prevents potential null pointer exceptions flagged by static analysis tools. [1] [2] [3] [4] [5] [6]